package com.sun.controller.admin;

import com.sun.utils.SystemConstant;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/admin")
public class SystemController {

    @RequestMapping("/login.html")
    public String login(){
        return "admin/login";
    }

    @RequestMapping("/home.html")
    public String home(){
        return "admin/home";
    }

    @RequestMapping("/desktop.html")
    public String desktop(){
        return "admin/desktop";
    }

    @RequestMapping("/logout")
    public String logout(HttpSession session){
        session.removeAttribute(SystemConstant.LOGINUSER);
        return "admin/login";
    }

    @RequestMapping("/toDeptManage")
    public String toDeptManage(){
        return "admin/dept/deptManage";
    }

    @RequestMapping("/toRoleManage")
    public String toRoleManage(){
        return "admin/role/roleManage";
    }

    @RequestMapping("/toEmployeeManage")
    public String toEmployeeManage(){
        return "admin/employee/employeeManage";
    }

    @RequestMapping("/toMenuManage")
    public String toMenuManage(){
        return "admin/menu/menuManage";
    }

    @RequestMapping("/toFloorManage")
    public String toFloorManage(){
        return "admin/floor/floorManage";
    }

    @RequestMapping("/toRoomTypeManage")
    public String toRoomTypeManage(){
        return "admin/roomType/roomTypeManage";
    }

    @RequestMapping("/toRoomManage")
    public String toRoomManage(){
        return "admin/room/roomManage";
    }

    @RequestMapping("/toOrdersManage")
    public String toOrdersManage(){
        return "admin/orders/ordersManage";
    }

    @RequestMapping("/toCheckinManage")
    public String toCheckinManage(){
        return "admin/checkin/checkinManage";
    }

    @RequestMapping("/toChartsYear")
    public String toChartsYear(){
        return "admin/charts/yearOfMoneyCharts";
    }

    @RequestMapping("/toChartsMonth")
    public String toChartsMonth(){
        return "admin/charts/monthOfMoneyCharts";
    }
}
